package com.wn.trade;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wn.trade.entity.BorrowRecord;
import com.wn.trade.service.IBorrowRecordService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @author yellow Docter
 * @date 2023 -03-03
 * @desc
 */
@SpringBootTest(classes = TradeApplication.class)
public class Demo01 {

    @Autowired
    private IBorrowRecordService iBorrowRecordService;

    @Test
    public void demo(){

        QueryWrapper<BorrowRecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(BorrowRecord::getUserId,
                Long.parseLong("1600307131273248770"));

        //1600307131273248770
        int count = (int) (iBorrowRecordService.count(queryWrapper) + 1);
        System.out.println("count = " + count);
    }

}
